<template>
  <dt-modal-info ref='info' title='查看文章' :width='800' class="import_article_modal">
    <div class="title">
      {{info.title}}
    </div>
    <div
      style="fontSize:12px;color: #999; font-family: PingFangSC-Regular, PingFang SC; line-height: 30rpx; margin-bottom: 32rpx;">
      文章来源「<span style="color: #4A6DDB;">{{ info.author }}</span>」
      <span style="margin-left: 20rpx;">{{ info.createDate }}</span>
    </div>
    <div class="content" v-html="info.content"></div>
  </dt-modal-info>
</template>
<script>
  import importApi from '@/biz/article/importArticle'
  export default {
    data() {
      return {
        info: {}
      }
    },
    methods: {
      show(id) {
        this.$refs.info.show()
        this.init(id)
      },
      init(id) {
        importApi.importArticleSelect(id).then(res => {
          this.info = res
          return res
        }).catch(err => {
          this.info = {
            title: '',
            content: ''
          }
        })
      }
    }
  }
</script>

<style lang='scss' scope>
  .import_article_modal {
    .title {
      font-size: 24px;
    }

    .content {
      img {
        width: 100%
      }

      video {
        width: 100%
      }
    }
  }
</style>